package com.lby.graduation.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.lby.graduation.entity.Post;
import com.lby.graduation.mapper.PostMapper;
import com.lby.graduation.service.PostService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 李兵耀
 * @since 2020-12-29
 */
@Service
public class PostServiceImpl extends ServiceImpl<PostMapper, Post> implements PostService {
@Resource
private PostMapper postMapper;
    @Override
    public List<Post> selectPost() {
        return postMapper.selectPost();
    }

    @Override
    public List<Post> selectPagePost(IPage<Post> page) {
        return postMapper.selectPagePost(page);
    }

    @Override
    public List<Post> selectUserPost(Integer userId) {
        return postMapper.selectUserPost(userId);
    }

    @Override
    public Post selectPostByPostId(Integer postId) {
        return postMapper.selectPostByPostId(postId);
    }

    /*批量删除*/
    @Override
    public int deleteByIds(List<Integer> idList) {
        return postMapper.deleteByIds(idList);
    }
}
